Skip to content

Add a context menu item to open options page#41

Merged
snipsnipsnip merged 3 commits intoexteditor:mainfrom
snipsnipsnip:open-options-from-context-menu
Oct 16, 2025
Merged

Add a context menu item to open options page#41
snipsnipsnip merged 3 commits intoexteditor:mainfrom
snipsnipsnip:open-options-from-context-menu

Conversation

@snipsnipsnip
Copy link
Copy Markdown
Member

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 16, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added an "open_options" command to quickly access the application settings, available through the context menu.
  • Documentation

    • Updated service status badges in README.
    • Updated documentation reference URLs for messenger API compatibility.

Walkthrough

This pull request introduces a new "open_options" command to the extension that opens the options page. Changes include manifest configuration, localization strings, command handler registration, a new UiUtil implementation, updated API definitions, and documentation URL corrections in Thunderbird messenger files.

Changes

Cohort / File(s) Summary
README and Documentation
README.md
Badge updates in Services section: removed legacy CodeRabbit and Codecov badges, added dynamic CodeRabbit PRs and Codecov coverage badges
Localization and Configuration
locales.toml, manifest_template.json
Added new manifest_commands_open_options_description translation block with multilingual descriptions; registered new open_options command in manifest with description reference
Command API and Core Logic
src/app-background/api.ts, src/app-background/command_handler.ts, src/root/background.ts
Extended CommandId union type to include "open_options"; added IUiUtil interface with openOptionsPage() method; updated CommandHandler constructor to accept uiUtil dependency and handle the new command; added context menu item for open_options in background script
UI Utilities
src/thunderbird/background_util/ui_util.ts
New UiUtil class implementing IUiUtil, providing openOptionsPage() method that delegates to messenger.runtime.openOptionsPage()
Data Model
src/ghosttext-adaptor/api.ts
Extended StoredOptions with two new fields: serverPort (number) and enableNotifications (boolean); updated IStoredOptionsLoader documentation comment
Thunderbird Messenger Documentation
src/thunderbird/messenger/alarms.ts, src/thunderbird/messenger/global.ts, src/thunderbird/messenger/scripting.ts
Updated documentation URLs from /en/128-esr-mv3/ to /en/esr-mv3/ across three messenger utility files

Sequence Diagram

sequenceDiagram
    participant User
    participant ContextMenu as Context Menu
    participant Handler as CommandHandler
    participant UiUtil as UiUtil
    participant Messenger as messenger.runtime

    User->>ContextMenu: Click "Open Options"
    ContextMenu->>Handler: handle("open_options")
    Handler->>UiUtil: openOptionsPage()
    UiUtil->>Messenger: openOptionsPage()
    Messenger-->>User: Opens options page
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Mixed complexity across multiple file types: new command registration and handler logic, dependency injection pattern, new interface implementation, data model extensions, and documentation updates. Straightforward control flow but distributed across several modules requiring contextual understanding of the command dispatch system.

Possibly related PRs

Poem

🐰 A new command hops into place,
Options page now opens with grace,
Through menus and handlers it springs,
With locales and configs and things—
The extension's utility extends! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request has no description and does not follow the repository’s template, which requires a license agreement confirmation, change type classification, a summary of current and new behavior, and manual testing steps, preventing reviewers from understanding the purpose and verifying the changes. Please add a pull request description using the provided template, including the license agreement checkbox, selection of change type, clear summaries of current and new behavior, and detailed manual testing steps to give reviewers sufficient context for evaluation.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title succinctly and accurately describes the main feature being introduced, namely adding a context menu item to open the options page, and is clear, concise, and free of extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@snipsnipsnip snipsnipsnip changed the title docs: update badges in README.md Add a context menu item to open options page Oct 16, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.12%. Comparing base (9152e79) to head (d0533b2).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/root/background.ts 0.00% 5 Missing ⚠️
src/app-background/command_handler.ts 66.66% 2 Missing ⚠️
src/thunderbird/background_util/ui_util.ts 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   47.12%   47.12%   -0.01%     
==========================================
  Files          59       60       +1     
  Lines        2264     2281      +17     
  Branches      292      294       +2     
==========================================
+ Hits         1067     1075       +8     
- Misses       1190     1199       +9     
  Partials        7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9152e79 and d0533b2.

📒 Files selected for processing (11)
  • README.md (1 hunks)
  • locales.toml (2 hunks)
  • manifest_template.json (1 hunks)
  • src/app-background/api.ts (2 hunks)
  • src/app-background/command_handler.ts (2 hunks)
  • src/ghosttext-adaptor/api.ts (1 hunks)
  • src/root/background.ts (1 hunks)
  • src/thunderbird/background_util/ui_util.ts (1 hunks)
  • src/thunderbird/messenger/alarms.ts (1 hunks)
  • src/thunderbird/messenger/global.ts (1 hunks)
  • src/thunderbird/messenger/scripting.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/thunderbird/background_util/ui_util.ts (1)
src/app-background/api.ts (1)
  • IUiUtil (18-21)
src/app-background/command_handler.ts (2)
src/app-background/compose_action_notifier.ts (1)
  • ComposeActionNotifier (4-57)
src/app-background/api.ts (1)
  • IUiUtil (18-21)
🔇 Additional comments (15)
src/thunderbird/messenger/alarms.ts (1)

3-3: LGTM! Documentation URL update is appropriate.

The change from version-specific /en/128-esr-mv3/ to the generic /en/esr-mv3/ path improves maintainability and ensures the documentation link remains valid across ESR versions.

src/thunderbird/messenger/scripting.ts (1)

3-3: LGTM! Consistent documentation URL update.

This change aligns with the documentation URL pattern being applied across the codebase.

src/thunderbird/messenger/global.ts (1)

3-3: LGTM! Documentation URL update is consistent.

This completes the consistent documentation URL updates across the Thunderbird messenger files.

README.md (1)

262-263: Badge updates look good, but PR title is misleading.

The badge updates are appropriate and enhance project visibility. However, the PR title "docs: update badges in README.md" does not accurately reflect the actual scope of changes. This PR introduces a new open_options command with full implementation including:

  • New CommandId type extension
  • IUiUtil interface addition
  • Context menu integration
  • Full translation support across 20+ languages

Consider updating the PR title to reflect the actual changes, such as "feat: add open_options command and update badges" or splitting documentation-only changes from functional changes into separate PRs.

src/ghosttext-adaptor/api.ts (2)

82-85: LGTM! Documentation improvements enhance code clarity.

The JSDoc comments added to the StoredOptions fields provide helpful context for developers.


88-91: LGTM! Interface documentation is more precise.

The updated comment "Manages access to options" is more accurate than the previous wording.

src/root/background.ts (1)

23-27: New menu item implementation looks correct, but inconsistent with PR title.

The new context menu item for open_options is properly structured and follows the same pattern as the existing stop_ghostbird item. However, this functional change contradicts the PR title "docs: update badges in README.md" which suggests documentation-only changes.

src/app-background/api.ts (2)

7-7: CommandId extension is correct, but inconsistent with PR title.

The addition of "open_options" to the CommandId union type is properly implemented. However, this is a functional change that contradicts the PR title suggesting documentation-only changes.


17-21: New IUiUtil interface is well-designed.

The interface provides a clean abstraction for UI utilities with a single responsibility method. The JSDoc is clear and concise.

locales.toml (2)

101-101: LGTM! Comment clarification is helpful.

The updated comment clarifies that this description is used both as a shortcut description and a context menu item label.


162-191: Complete i18n support for new command, but inconsistent with PR title.

The translation block provides comprehensive support across 27 languages, following the established pattern. However, this is a functional addition supporting the new open_options command, which contradicts the PR title "docs: update badges in README.md".

manifest_template.json (1)

52-55: LGTM!

The new open_options command is correctly added to the manifest with proper localization reference.

src/app-background/command_handler.ts (2)

23-24: LGTM!

The new command case correctly delegates to the uiUtil implementation, and the pattern is consistent with other command handlers.


9-12: CommandHandler is instantiated via DI, no manual new calls
CommandHandler is created by the wireless DI container (auto‐wiring via listClasses and constructor parsing) and will receive its uiUtil dependency automatically; there are no manual new CommandHandler invocations to update.

Likely an incorrect or invalid review comment.

src/thunderbird/background_util/ui_util.ts (1)

1-11: LGTM!

The UiUtil class correctly implements the IUiUtil interface and follows the dependency injection pattern used throughout the codebase. The delegation to messenger.runtime.openOptionsPage() is the appropriate WebExtension API call.

@snipsnipsnip snipsnipsnip added this pull request to the merge queue Oct 16, 2025
Merged via the queue into exteditor:main with commit b02a182 Oct 16, 2025
4 checks passed
@snipsnipsnip snipsnipsnip deleted the open-options-from-context-menu branch October 16, 2025 16:42
@github-project-automation github-project-automation bot moved this from 📥️Inbox to 🪺Experimental in Ghostbird Issues Oct 16, 2025
@snipsnipsnip snipsnipsnip linked an issue Oct 29, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Feature] Add a way to disconnect using only a mouse

1 participant